package cn.lili.modules.wildfirechat;

//import cn.wildfirechat.pojos.InputOutputSensitiveWords;
//import cn.wildfirechat.sdk.AdminConfig;
//import cn.wildfirechat.sdk.SensitiveAdmin;
//import cn.wildfirechat.sdk.model.IMResult;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.core.RedisTemplate;

import java.util.List;

//@Configuration
//public class ImConfig implements ApplicationRunner {
//
//    @Autowired
//    private RedisTemplate redisTemplate;
//
//    @Value("${com.imSecretKey:57270db7-3b5f-4f17-95c5-157cf130dc68}")
//    private String imSecret;
//
//    @Value("${com.imAdminUrl:http://fy.chainlettre05.com:30080}")
//    private String imAdminUrl;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        AdminConfig.initAdmin(imAdminUrl, imSecret);
//
//        IMResult<InputOutputSensitiveWords> swResult = SensitiveAdmin.getSensitives();
//        List<String> wordsList = swResult.getResult().getWords();
//        for (String words : wordsList) {
//            redisTemplate.boundSetOps("word").add(words);
//        }
//    }
//}
